<template>
	<view>
		<!-- 下级订单  顶部 -->
		<view class="subordinate_box">
			<view class="today_invite">
				<text class="num">￥{{info.childComTotal}}</text>
				<text>奖励总数</text>
			</view>
			<view class="history_invite">
				<text class="num">{{info.childComCount}}</text>
				<text>订单数</text>
			</view>
		</view>
		
		
		<!-- 下级订单列表 -->
		<view class="subordinate_order" v-for="(item,index) in Subordinate_detail" :key="index">
			<view class="order_top">
				<text class="num">订单号：{{item.order_sn}}</text>
				<text>已入账</text>
			</view>
			
			<view class="order_content" v-for="(item_val,index_val) in item.order_item" :key="index_val">
				<image :src="item_val.g_pic" mode=""></image>
				<view class="order_info">
					<view class="info">
						<text class="tit">{{item_val.goodname}}</text>
						<text class="num">x{{item_val.nums}}</text>
					</view>
					<view class="price">
						<text>￥{{item_val.discount_price}}</text>
						<text class="price_col">奖励：￥{{item_val.comssion}}</text>
					</view>
				</view>
				
			</view>
			
			<view class="bot">
				<view class="num">商品总金额￥{{item.order_money}}</view>
				<view class="money">总奖励：￥{{item.comtotal}}</view>
			</view>
		</view>
		
		<view class="no_box" v-if="Subordinate_detail.length == 0">
			<image src="https://wanchuyun-img.oss-cn-beijing.aliyuncs.com/guomai/c5ffa53ec8059a251ad3fdb50f56d6f827e1b42e.png" mode=""></image>
		</view>
	</view>
</template>

<script>
	const app = getApp()
	export default {
		data() {
			return {
				child_id: '',
				Subordinate_detail: '',
				info: ''
			};
		},
		onLoad(opt) {
			this.child_id = opt.child_id
			this.getSubordinateDetail()
		},
		methods:{
			// 下级列表
			getSubordinateDetail(){
				let that = this;
				app.globalRequest({
					api: app.getApi().user.TeamCenterDetail,
					data:{
						child_uid: that.child_id
					}
				}).then(res => {
					if (res.code == 1) {
						that.Subordinate_detail = res.data.childComList
						that.info = res.data
					}
				}).catch(err => {
				
				})
			},
		}
	}
</script>

<style lang="scss">
	page{
		padding-bottom: 60rpx;
	}
	.subordinate_box{
		width: 90%;
		margin: 30rpx auto 20rpx;
		background: url('https://wanchuyun-img.oss-cn-beijing.aliyuncs.com/guomai/171d6d5fb3b3256286ef2428846e251e99cca320.png');
		background-position: center;
		background-size: cover;
		background-repeat: no-repeat;
		padding: 50rpx 0;
		box-sizing: border-box;
		display: flex;
		align-items: center;
		height: 266rpx;
		.today_invite,.history_invite{
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			width: 50%;
			border-right: 2rpx solid #EEEEEE;
			text{
				font-size: 28rpx;
				color: #fff;
			}
			.num{
				font-size: 52rpx;
				color: #fff;
				margin-bottom: 10rpx;
			}
		}
	}
	
	.subordinate_order{
		width: 90%;
		margin: 30rpx auto 0;
		padding: 24rpx;
		box-sizing: border-box;
		background-color: #fff;
		border-radius: 12rpx;
		.order_top{
			display: flex;
			align-items: center;
			justify-content: space-between;
			text{
				color: #EC1818;
				font-size: 24rpx;
			}
			.num{
				font-size: 24rpx;
				color: #999999;
			}
		}
		.order_content{
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-top: 40rpx;
			flex-wrap: wrap;
			image{
				width: 176rpx;
				height: 176rpx;
			}
			.order_info{
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				width:68%;
				height: 176rpx;
				.info{
					display: flex;
					justify-content: space-between;
					.tit{
						width: 85%;
						font-size: 28rpx;
						color: #333;
						 overflow: hidden; 
						  text-overflow: ellipsis;
						  display: -webkit-box;
						  -webkit-box-orient: vertical; 
						  -webkit-line-clamp: 3;
					}
					.num{
						color: #999999;
						font-size: 28rpx;
					}
				}
				
				.price{
					display: flex;
					align-items: center;
					justify-content: space-between;
					text{
						font-size: 28rpx;
						color: #333;
						
					}
					.price_col{
							color: #EC1818;
					}
				}
				
				
			}
			
		}
		.bot{
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-top: 30rpx;
			padding-top: 20rpx;
			border-top: 2rpx solid #BCBCBC;
			.num{
				color: #333333;
				font-size: 24rpx;
			}
			.money{
				color: #111111;
				font-size: 28rpx;
				font-weight: bold;
			}
		}
	}
	.no_box{
		width: 520rpx;
		height: 430rpx;
		margin: 400rpx auto;
		image{
			width: 100%;
			height: 100%;
		}
	}
	
</style>
